import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/vue-admin-template/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}


export function getList(params) {
  return request({
    url: '/vue-admin-template/user/list',
    method: 'post',
    params
   
  })
}

export function addUser(data) {
  return request({
    url: '/vue-admin-template/user',
    method: 'post',
    data
   
  })
}


export function updateUser(data) {
  return request({
    url: '/vue-admin-template/user',
    method: 'put',
    data
   
  })
}


export function deleteUser(params) {
  return request({
    url: '/vue-admin-template/user',
    method: 'delete',
    params
   
  })
}



export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

export function getUserMenuList(userId) {
  return request({
    url: `/vue-admin-template/user/${userId}`,
    method: 'get'
  })
}


